How to continue to execute after a box

Hi everyone, i know the subject of the question is not very clear but i ll give you details in a second. I have a loop looking for all formal modules and after performs some actions on these modules which contain a particular attribute. However this attribute may exist in many views at the same time so before going further i ask user to choose the view for the current in which (s)he is interested. After (s)he clicks "Load" i load the view and continue to perform the same actions. My problem is the part which realizes these actions work perfectly well, but when i insert the new part (which looks for all views and find the ones which contain this attribute), it does not continue to execute rest of the code. I mean it finds perfectly well all views and when i make a choice it loads the views but then it stops, it does not execute other parts and i cannot see why. I sent you a part of the code, in the hope that it might be useful for you. thanks in advance for your help. Kind regards
 

Module m = read(NameItem, true) // Open it, or get existing handle if already open
      if(canRead m) {
 
void viewloader(DB my_box) {
 
string name_of_view_chosen = get(view_name_displayer)
print name_of_view_chosen
load view name_of_view_chosen
halt
}
 
view_name_box = create("Pick Views", styleCentered|styleFixed|styleFloating)
string name_view
int countViews = 0
Module m = current
int view_counter = 0
int countViews_bis
int number_of_views
 
 
//First count the number of views in module so we can specify the array size
 
for name_view in views current Module do {
    countViews++
}
 
//End view count
 
//Create array and reset countViews
 
string viewList[countViews]
countViews = 0 //reset
 
//End array create and reset
 
//Build array list and list out the views
for name_view in views current Module do {
        viewList[countViews] = name_view
        countViews++
}
 
 
//End build array
 
string showview = ""
countViews = countViews - 1
countViews_bis = countViews
 
 
//Take each view name from array and list columns
 
Column c
string vname
string melih
string tester = "V_OrganicAllocation"
 
while (countViews >= 0) {
        showview = viewList[countViews]
        load view(showview)
        countViews = countViews - 1
         vname = currentView(m)
     
        // Now list the contents of the view
 
                for c in m do {
               melih = attrName(c)
               if (melih == tester) {
                 view_counter++
                }                
       }//End for c in m
}
string view_name_holder[view_counter]
view_counter = 0
 
while (countViews_bis >= 0) {
        showview = viewList[countViews_bis]
        load view(showview)
        countViews_bis = countViews_bis - 1
         vname = currentView(m)
     
        // Now list the contents of the view
 
                for c in m do {
               melih = attrName(c)
               if (melih == tester) {
                view_name_holder[view_counter] = vname
                       view_counter++            
                }  
             }    
            
       } //End for c in m
view_name_displayer = multiList(view_name_box,"The views containing 'V_OrganicAllocation' for the current module are:",3,view_name_holder,view_counter)
number_of_views = noElems view_name_displayer
 
if(number_of_views == 0) {
close(m)
}
 
else {
apply(view_name_box, "Load", viewloader)
//close(view_name_box, true, closeViewDB)
show(view_name_box)

SystemAdmin - Mon Apr 27 10:33:57 EDT 2009

Re: How to continue to execute after a box
Ron_Lewis - Mon Apr 27 11:07:52 EDT 2009

Since show is the last statement executable you have at least two options.

Option 1 use block instead of show.
Option 2 put your code before show.

Re: How to continue to execute after a box
SystemAdmin - Tue Apr 28 03:48:19 EDT 2009

Ron_Lewis - Mon Apr 27 11:07:52 EDT 2009
Since show is the last statement executable you have at least two options.

Option 1 use block instead of show.
Option 2 put your code before show.

Thanks Ron, changing simply show to block made my code work out as I wished. Thanks one more time.